package culosic.mdpocket.html;

public class NodeImg extends HtmlNode
{
	private String src;
	private String alt;
	private String title;

	public NodeImg(String src, String alt, String title){
		this.set(src, alt);
		this.title = title;
	}
	
	public NodeImg(String src, String alt){
		this.set(src, alt);
	}

	public void set(String src, String alt){
		this.src = src;
		this.alt = alt;
	}

	@Override
	public void show(HtmlOut out)
	{
		out.setText("<img src=\"" + src + "\" alt=\"" + alt + "\""
						  + (title == null ? "" : (" title=\"" + title + "\""))
						  + ">");
		out.put();
	}
}
